package com.ruoyi.passenger.order.mapper;

import com.ruoyi.passenger.order.domain.TOrder;
import com.ruoyi.passenger.order.ro.GetHistoricalOrderParam;
import com.ruoyi.passenger.order.vo.GetHistoricalOrderVOCopy;
import com.ruoyi.passenger.order.vo.GetOrderLocationVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 订单Mapper接口
 *
 * @author ruoyi
 * @date 2021-12-01
 */
public interface TOrderMapper {
    /**
     * 查询订单
     *
     * @param id 订单主键
     * @return 订单
     */
    TOrder selectTOrderById(Long id);

    /**
     * 查询历史订单
     *
     * @param param
     * @return
     */
    List<GetHistoricalOrderVOCopy> selectTOrderByPlatformId(@Param("param") GetHistoricalOrderParam param);
    /**
     * 查询历史订单
     *
     * @param param
     * @return
     */
    List<GetHistoricalOrderVOCopy> selectTOrderByPlatformIdAndPassengerId(@Param("param") GetHistoricalOrderParam param);

    /**
     * 创建订单
     * @param order
     */
    void addOrder(TOrder order);

    /**
     * 根据支付流水号获取订单
     * @param payOrderId
     * @return
     */
    TOrder selectOrderByPayOrderId(String payOrderId);

    /**
     * 获取未同步行程信息的订单
     * @return
     */
    List<TOrder> selecttOrderListWithNoSync();

    void updateOrder(TOrder order);

    List<String> getPayOrderId();

    int updatePayStatus(@Param("payOrderId") String payOrderId, @Param("statusCode") String statusCode);

    void updateBatchPayStatus(List<Map> payList);

    void updateOrderList(List<TOrder> list);

    List<GetOrderLocationVO> getAddress();

    void updateOrderAddressList(List<GetOrderLocationVO> list);
}
